/**
 * ClassName ArithmeticExceptionTest
 * Description TODO
 * Author Hexiao
 * Date 2018/8/22 15:52
 * Version 1.0
 **/
public class ArithmeticExceptionTest {
    int i;
    public static void main(String[] args) {
        int y = 10;
        ArithmeticExceptionTest test = new ArithmeticExceptionTest();
        try {
            System.out.println(y/test.i);//算术异常java.lang.ArithmeticException: / by zero
        }catch (ArithmeticException  e){
         //  e.printStackTrace();//在命令行打印异常信息在程序中出错的位置及原因
         // e.getMessage();//获取异常信息，返回字符串
            System.out.println(e.getMessage());
            System.out.println(".........");
        }
    }

}